package cn.hc.share.util;

import java.math.BigDecimal;


public class StringUtil {
	public static boolean isNotNull(String str){
		return !isNull(str);
	}
	
	public static boolean isNull(String str){
		if(str == null || str.trim().isEmpty())
			return true;
		return false;
	}
	
	public static boolean isNumber(String str)
	{
		try{
			new BigDecimal(str);
			return true;
		}catch (NumberFormatException e) {
			return false;
		}
	}
	
	
	/**
	 * 通过字符数组获取用逗号分割的字符串
	 * @param strArray
	 * @return
	 */
	public static String getStringByArr(String... strArray){
		StringBuilder sb = new StringBuilder(" ");
		for(String s : strArray){
			sb.append("'").append(s).append("',");
		}
		sb.deleteCharAt(sb.length()-1);
		return sb.toString().trim();
	}
}
